﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;

namespace XNA_Game_Framework
{
	public class MenuItem
	{
		public delegate void RunMethod(object sender, EventArgs e);
		public event RunMethod Click;

		object menu;
		string text;

        public object Parent
		{
			get { return menu; }
			set { menu = value; }
		}

		public string Text
		{
			get { return text; }
			set { text = value; }
		}

        public MenuItem(InputHandler inputHandler, object menu, string text)
		{
			Text = text;
			Parent = menu;
		}

		internal void OnItemClicked()
		{
			OnClick(EventArgs.Empty);
		}

		protected virtual void OnClick(EventArgs e)
		{
			if (Click != null)
			{
				Click(this, e);
			}
		}
	}
}
